/*
 * Copyright (c) 2020, 2023, 3044483124@qq.com All rights reserved.
 *
 */
package itcast;
import java.util.Calendar;
/**
 * <p>Project: JavaStudy - FormatDateTime
 * <p>Powered by jiangbo On 2023-01-31
 * 14:39:36
 * <p>Created by IntelliJ IDEA
 *
 * @author jiangbo [3044483124@qq.com]
 * @version 1.0
 * @since 8/17
 */
public class FormatDateTime {
    public static void main(String[] args) {
//时间戳(long类型的数字) 系统日期
        long time = System.currentTimeMillis();
        System.out.printf("%tY-%tm-%td%n",time,time,time);
        System.out.printf("%tF%n",time);
        System.out.printf("%tY年%<tm月%<td日%n",time);
        System.out.println(time);
       // System.out.printf("%tY年%<tm月%<td日%n",System.currentTimeMillis());

//格式化输出 System.out.printf("",参数列表);
//2022-10-14 %n是换行 %tF
        System.out.println("#".repeat(35));
        System.out.printf("%tF%n",System.currentTimeMillis());
//16:15:20
        System.out.printf("%tT%n",System.currentTimeMillis());
//2022-10-14 16:15:20
        System.out.printf("%tF %<tT%n",System.currentTimeMillis());
//2022年10月14日 星期五
        System.out.printf("%tY年%<tm月%<td日 %<tA%n",System.currentTimeMillis());
        System.out.printf("%tA",System.currentTimeMillis());
        System.out.println("\n-------------------------------");
//实例化对象
        Calendar c = Calendar.getInstance();
//Calendar.OCTOBER 代表9 0 代表1月 9代表10月 也可以直接输入10-1 直接输入9
        c.set(1985,Calendar.OCTOBER,20,8,0,0);

        System.out.printf("%tF %<tT %<tA %<tp%n",c);
        c.set(2022,9,1,8,0,0);
        System.out.printf("%tF %<tT %<tA %<tp%n",c);
        c.set(2000,8,16,23,44,56);
        System.out.printf("%tF %<tT %<tA %<tp",c);
    }

    }


